package cn.school.service;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.AdminDao;
import cn.school.entity.Admin;
import cn.school.util.MyBatisUtil;

public class AdminService {
	public Admin login(String u, String p) {
		SqlSession s = MyBatisUtil.getSqlsession();
		try {
			AdminDao ad = s.getMapper(AdminDao.class);
			return ad.login(u, p);
		} finally {
			MyBatisUtil.getclose(s);
		}
	}
}
